<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<div class="anti-ransomware">
  <div class="detail">
    <div class="title">
      <ng-container [ngSwitch]="type">
        <ng-container *ngFor="let info of antiRansomwareType">
          <span *ngSwitchCase="info.value">
            {{ info.label | i18n }}
          </span>
        </ng-container>
      </ng-container>
    </div>
    <div class="refresh-box">
      <div>{{ 'common_home_latest_detection_result_label' | i18n }}</div>
      <div>{{ queryTime | date: 'yyyy-MM-dd HH:mm:ss' }}</div>
    </div>

    <div class="detection-resource jumpable" (click)="navigate()">
      <div class="num navigator">{{ detectResourceCount }}</div>
      <div class="title">
        {{ 'common_home_detected_resources_label' | i18n }}
      </div>
    </div>

    <div
      class="anti-ransomism-strategy jumpable"
    >
      <ng-container *ngIf="type === 0 || type === 3 || type === 4">
        <div class="jumpable" (click)="navigate(null,RouterUrl.ExplorePolicyAntiPolicySetting)">
            <div class="num navigator">{{ totalCount }}</div>
            <div class="title">
                {{ 'common_home_detection_policies_label' | i18n }}
            </div>
        </div>
      </ng-container>

      <ng-container *ngIf="type === 2">
        <div class="infected">
          <div class="jumpable" (click)="navigate(DataMap.Detection_Copy_Type.infected.value)">
            <div class="num">
              <span class="hover navigator">
                {{ infectedCount }}
              </span>
            </div>
            <div class="title">
              <div class="infected-circle"></div>
              <div class="text">{{ 'common_home_infected_label' | i18n }}</div>
            </div>
          </div>
        </div>
      </ng-container>
    </div>
  </div>
  <div
    *ngIf="this.detectingCount !== 0"
    [class]="['chart-box', 'chart-box-' + type]"
  ></div>
  <div
    *ngIf="this.detectingCount === 0"
    [class]="['chart-box', 'chart-box-' + type, 'static']"
  ></div>
</div>
